@extends('admin')

@section('content')

    <p class="mb10">
        <a href="{{url('admin/product/newr')}}" class="btn J_dialog" title="添加类别"><span class="add"></span>添加类别</a>
    </p>

    <div class="h_a">搜索</div>
    <div class="search_type cc mb10">
        <form action="{{url('admin/product/region')}}" method="get" class="search_form">
            <label for="search_title">地域名称：</label>
            <input type="text" name="title" value="{{isset($appends['title']) ? $appends['title'] : ''}}" id="search_title" class="input length_2 mr10"/>
            <button type="submit" class="btn">搜索</button>
        </form>

    </div>

    <div class="table_list">
        <div id="data_list">
            <table class="items">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>地域名称</th>
                    <th>上级地域</th>
                    <th>更新人</th>
                    <th>状态</th>
                    <th>输入日期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($list as $item)
                    <tr>
                        <td>{{$item->sysRegionId}}</td>
                        <td>{{$item->regionName}}</td>
                        <td>{{ 0 == $item->superiorRegion ? "全国" : ($item->hasFather($item->superiorRegion) ? $item->father->regionName : "上级地域数据被破坏")}}</td>
                        <td>{{$item->inputMan}}</td>
                        <td>{{$item->memo}}</td>
                        <td>{{$item->inputDate}}</td>
                        <td>
                            <a href="{{url('admin/product/newr/'.$item->sysRegionId)}}" title="编辑 {{$item->name}}" class="mr10 J_dialog">[编辑]</a>
                            <a href="{{url('admin/product/delr/'.$item->sysRegionId)}}" class="mr10 J_ajax_del">[删除]</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

        <div class="summary">
            共有 {{$list->total()}} 条数据
        </div>
        @if ($list->hasPages())
            <div class="pager">
                {!! $list->render() !!}
            </div>
        @endif
    </div>

@stop